package springboot_select_insert.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import springboot_select_insert.entity.ChaEntity;
import springboot_select_insert.service.ChaService;

@RestController
@RequestMapping(value = "/main")
public class ChaController {
	@Autowired
	private ChaService chaService;
	@GetMapping(value = "/select")
	public List<ChaEntity> selectController(){
		System.out.println("开始查询中……");
		return chaService.selectService();
	}
	@GetMapping(value = "/insert")
	public boolean insertController(ChaEntity chaEntity) {
		System.out.println("开始插入中……");
		return chaService.insertService(chaEntity);
		
	}
}
